package org.example.yongyou;

import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;

public class 销售订单详情查询_bip {
    private static String accessToken = "07e3c91c3c864891bec8f236a868b873";

    public static void main(String[] args) {
        String dizhi = "/yonbip/sd/voucherorder/detail";

//        请求地址	/yonbip/scm/othoutrecord/list
//        请求方式	POST
//        data.get("gatewayUrl") = https://c2.yonyoucloud.com/iuap-api-gateway
//        response.getData().getAccessToken() = 9fa5cbb51cc54e9abff982f10a5749e6


        String url = "https://c2.yonyoucloud.com/iuap-api-gateway" + dizhi + "?access_token=" + accessToken
                + "&id=2059277999268691968";//这里的id是销售订单列表查询接口返回的id或者是orderId

        //将accessToken放入请求头
        HttpRequest post = HttpUtil.createGet(url);


        String body = post.execute().body();
        //解析返回的json数据
        JSONObject jsonObject = JSONUtil.parseObj(body);
        JSONObject data = (JSONObject) jsonObject.get("data");
        System.out.println("data = " + data);
    }
}
